import 'package:flutter/cupertino.dart';

class LoginProvider extends ChangeNotifier{

  bool isLogin = false;

  String username = "";

  String password = "";

  String token = "";

  String uid = "";

  String videoPath = "";

  bool isPlay = true;

  String productDetailCode = "";

  String productMaxUrl = '';

  String openId = '';

  String html = "";

  bool cityStart = false;

  String names = "张三风";

  String phones = "1388889138";

  String cityName = "广东省深圳市";

  String alertName = "张三风";

  String alertAddress = "武当街道";

  String longitude = "114.00893";  //经度

  String latitude = "22.58101";  //纬度

  String addressTime = "";

  void setaddressTime(String? alerts){

    if(alerts != null){
      addressTime = alerts;
    }

  }

  String getaddressTimeName(){
    return addressTime;
  }

  void setLatitude(String? alerts){

    if(alerts != null){
      latitude = alerts;
    }

  }

  String getLatitudeName(){
    return latitude;
  }

  void setlongitude(String? alerts){

    if(alerts != null){
      longitude = alerts;
    }

  }

  String getlongitudeName(){
    return longitude;
  }

  void setAlertName(String? alerts){
    if(alerts != null){
      alertName = alerts;
    }
  }

  String getAliertName(){
    return alertName;
  }

  void setAliertAddress(String? alerts){
     if(alerts != null){
       alertAddress = alerts;
     }
  }

  String getAliertAddress(){
    return alertAddress;
  }

  void setNames(String? nams11){
    if(nams11 != null){
      names = nams11;
    }
  }

  String getNames(){
    return names;
  }

  void setPhones(String? phones11){
    if(phones11 != null){
      phones = phones11;
    }
  }

  String getPhones(){
    return phones;
  }

  void setCityName(String? cityNames11){
    if(cityNames11 != null){
      cityName = cityNames11;
    }
  }

  String getCityName(){
    return cityName;
  }

  void setCityStart(bool? cityStart111){
    if(cityStart111 != null){
      cityStart = cityStart111;
    }
  }

  bool getCityStart(){
    return cityStart;
  }

  void setHtml(String? htmls){
    if(html != null){
      html = htmls.toString();
    }
  }


  String getHtml(){
    return html;
  }

  void setOpenId(String? openid){
    if(openId != null){
      openId = openid.toString();
    }
  }

  String getOpenId(){
    return openId;
  }

  void setProductMaxUrl(String? url){
    if(url != null){
      productMaxUrl = url;
    }
  }

  String getProductMaxUrl(){
    return productMaxUrl;
  }

  void setProductDetailCode(String? code){
    if(code != null){
      productDetailCode = code;
    }
  }

  String getProductDetailCode(){
    return productDetailCode;
  }

  void setIsPlay(){
    isPlay = !isPlay;
  }

  bool getIspLay(){
    return isPlay;
  }

  void setVideoPath(String? vioPath){
    if(vioPath != null){
      videoPath = vioPath;
    }else{
      videoPath = "";
    }

  }

  String getVideoPath(){
    return videoPath;
  }

  String getUid(){
    return uid;
  }

  void setUid(String id){
    uid = id;
  }

  bool getIsLogin(){
    return isLogin;
  }

  bool setIsLogin(bool islogin){
     isLogin = islogin;
     return isLogin;
  }

  //设置用户名和密码
  void setUserName(String user){
    username = user;
    notifyListeners(); //观察者状态刷新
  }

  void setToken(String tokens){
    token = tokens;
    notifyListeners();
  }

  void setPass(String pass){
    password = pass;
    notifyListeners();
  }

  String getUserName(){
    return username;
  }

  String getToken(){
    return token;
  }


}